# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Contributor: Steven Guikal <void@fluix.one>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=py3-connexion
_pkgname=connexion
pkgver=3.0.5
pkgrel=0
pkgdesc="Swagger/OpenAPI First framework for Python on top of Flask with automatic endpoint validation & OAuth2 support"
url="https://github.com/spec-first/connexion"
arch="noarch !riscv64"  # limited by py3-swagger-ui-bundle
license="Apache-2.0"
makedepends="
	py3-gpep517
	poetry
	"
depends="
	py3-asgiref
	py3-httpx
	py3-inflection
	py3-jinja2
	py3-jsonschema
	py3-python-multipart
	py3-requests
	py3-starlette
	py3-typing-extensions
	py3-werkzeug
	py3-yaml
	python3
	"
checkdepends="
	py3-a2wsgi
	py3-flask
	py3-pytest-asyncio
	py3-pytest-xdist
	py3-swagger-ui-bundle
	uvicorn
	"
subpackages="$pkgname-pyc"
source="
	https://github.com/spec-first/connexion/archive/$pkgver/$_pkgname-$pkgver.tar.gz
	fix-test-import-name.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/connexion*.whl
}

sha512sums="
65b0990f6a47d9401688b5c89557293599f6191e14f7badeb24b7239d3a4c8c6a2a3d14e044ba8544f3d97adc8a8164f600a9bdc231a6b547ac299c67f364fc9  connexion-3.0.5.tar.gz
5564f51b8980daf94d18f4c32bec478bb39b734f11b13aff6ab5adf20528cd83823a3d216d044eae3f83c296c72df8d7d255386c0aa354dc729878b3ace5c2ee  fix-test-import-name.patch
"
